package cordoba.domain
{
    import cordoba.application.LoadConfigurationEvent;
    
    import mx.collections.ArrayCollection;
    import mx.rpc.events.ResultEvent;
    import mx.rpc.http.mxml.HTTPService;

    [Bindable]
    public class Configuration
    {
        
        [Inject]
        public var service:HTTPService;
        
        [MessageDispatcher]
        public var dispatcher:Function;
        
        
        [Init]
        public function init(): void {
            service.send();
            service.addEventListener(ResultEvent.RESULT, onResult);
        }
        
        private function onResult(event:ResultEvent): void {
            dispatcher(new LoadConfigurationEvent(event.result));
        }
        
    }
}